/**
 * Copyright (C), 2015-2020, 云帐房
 * FileName: DemoController
 * Author:   cjz
 * Date:     2020/5/15 下午12:09
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.yzf.wisecoder.controller;

import cn.hutool.core.util.RandomUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

/**
 * @ClassName : DemoController
 * @Description : 大屏功能
 * @Author : cjz
 * @Date: 2020-05-15 12:09
 */
@RestController
@RequestMapping("/wise")
@Api("大屏功能测试")
public class DemoController {

    @Data
    public static class A{
        private String b;
        private List a;

    }

    @ApiOperation("http接口测试")
    @GetMapping("/http")
    public Object http(){



        List<Map> result = Lists.newArrayList();

        Map<String,String> map = Maps.newHashMap();
        map.put("user", "cjz");
        map.put("sex", "男");
        map.put("list", null);

        result.add(map);


        map = Maps.newHashMap();
        map.put("user", "张三");
        map.put("sex", "女");
        result.add(map);

//        A a = new A();
//        a.b = "aaaa";
//
//        return a;
        return result;
    }

    @ApiOperation("地区")
    @GetMapping("/map")
    public Object map(){

        List<Map> result = Lists.newArrayList();
        Map<String, Object> row = new HashMap<>();
        row.put("area","江苏省");
        row.put("value", RandomUtil.randomInt(1, 35));
        result.add(row);

        row = new HashMap<>();
        row.put("area","河南省");
        row.put("value", RandomUtil.randomInt(1, 35));
        result.add(row);

        row = new HashMap<>();
        row.put("area","浙江省");
        row.put("value", RandomUtil.randomInt(1, 35));
        result.add(row);

        row = new HashMap<>();
        row.put("area","北京市");
        row.put("value", RandomUtil.randomInt(1, 35));
        result.add(row);

        return result;
    }
}
